﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
namespace Project01
{
  public sealed  class Move
    {
      public static Vector2 MoveCircle(float angle, float distance, Vector2 centre)
      {
          return new Vector2((float)(distance * Math.Cos(angle)), (float)(distance * Math.Sin(angle))) + centre;
      }
      public static Vector2 MoveCircle(float angle, Vector2 currentPos, Vector2 centre)
      {
          double distance = Math.Sqrt(Math.Pow(currentPos.X - centre.X, 2) + Math.Pow(currentPos.Y - centre.Y, 2));
          return new Vector2((float)(distance * Math.Cos(angle)), (float)(distance * Math.Sin(angle)));
      }
      public static Vector2 MoveVertical(Vector2 CurrentPos,float distance)
      {
          return new Vector2(CurrentPos.X, CurrentPos.Y - distance);
      }
      public static Vector2 MoveHorizontal(Vector2 CurrentPos, float distance)
      {
          return new Vector2(CurrentPos.X - distance, CurrentPos.Y);
      }
       //SP1.Rotation = MathHelper.Clamp((float)Math.Sin(rotation), -0.7f, 0.7f);
          //SP1.Position = Move.MoveZigZac(SP1.Position, 1.25f, SP1.Rotation);
      public static Vector2 MoveZigZac (Vector2 CurrentPos,float distance,float Rotation) 
      {
          return new Vector2(CurrentPos.X - Rotation*distance, CurrentPos.Y+distance/2);
      }



      public static Vector2 toAngle(float angle)
      {
          return new Vector2((float)Math.Cos(angle), (float)Math.Sin(angle));
      }

      public static Vector2 MoveParaPol(Vector2 CurrentPos, float Distance, float angle)
      {
          CurrentPos.X += Distance;
          CurrentPos.Y += ((float)Math.Cos(angle) * Distance);
          return CurrentPos;
      }
    }
}
